/*
 * UAE - The Un*x Amiga Emulator
 *
 * Not a parser, but parallel and serial emulation for Win32
 *
 * Copyright 1997 Mathias Ortmann
 * Copyright 1998-1999 Brian King
 */

#pragma once

#define PRTBUFSIZE 65536

int setbaud(long baud);
void getserstat(int* status);
void setserstat(int mask, int onoff);
int readser(int* buffer);
int readseravail();
void writeser(int c);
int openser(const TCHAR* sername);
void closeser();
void doserout();
void closeprinter();
void flushprinter();
int checkserwrite();
void serialuartbreak(int);

#define TIOCM_CAR 1
#define TIOCM_DSR 2
#define TIOCM_RI 4
#define TIOCM_DTR 8
#define TIOCM_RTS 16
#define TIOCM_CTS 32

extern void unload_ghostscript();
extern int load_ghostscript();

#define MAX_MIDI_PORTS 16
struct midiportinfo
{
    TCHAR* name;
};
extern struct midiportinfo midiinportinfo[MAX_MIDI_PORTS];
extern struct midiportinfo midioutportinfo[MAX_MIDI_PORTS];

#define MAX_SERPAR_PORTS 32
struct serparportinfo
{
    CString dev;
    CString cfgname;
    CString name;
};
extern struct serparportinfo comports[MAX_SERPAR_PORTS];
extern struct serparportinfo parports[MAX_SERPAR_PORTS];

extern int enumserialports();
extern int enummidiports();
void sernametodev(CString* sername);
void serdevtoname(CString* sername);

extern void epson_printchar(byte c);
extern int epson_init(const TCHAR* printername, int pins);
extern void epson_close();

#define PARALLEL_MATRIX_TEXT 1
#define PARALLEL_MATRIX_EPSON 2
#define PARALLEL_MATRIX_EPSON9 2
#define PARALLEL_MATRIX_EPSON24 3
#define PARALLEL_MATRIX_EPSON48 4